package com.bw.controller;

import com.bw.entity.Dict;
import com.bw.entity.Zhexiantu;
import com.bw.mapper.ZxtMapper;
import com.bw.service.ZxtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class EchartsController {

    @Autowired
    ZxtService zxtService;


    @RequestMapping("/echartsPage.do")
    public String echartsPage(Model model){
        // 研制单位下拉框
      List<Dict>  danweiList =  zxtService.listDanwei();
        model.addAttribute("danweiList",danweiList);
        return "echartsPage";
    }

    @RequestMapping("/zxt.do")
    @ResponseBody
    public List<Zhexiantu> zxt(Integer danweiId){

        return zxtService.zxtByParam(danweiId);
    }

}
